import { RouteRecordRaw } from 'vue-router';
import { Layout,ParentLayout } from '@/router/constant';
import { ConstructOutline,PrismSharp,KeyOutline,Man} from '@vicons/ionicons5';
import { UserOutlined} from '@vicons/antd';
import {renderIcon, renderIconfontIcon} from '@/utils';

const routeName = 'system';

const routes: Array<RouteRecordRaw> = [
  {
    path: '/system',
    name: routeName,
    redirect: '/system/dept',
    component: Layout,
    meta: {
      title: '系统管理',
      icon: renderIcon(ConstructOutline),
      sort: 1,
    },
    children: [
      {
        path: 'dept',
        name: `${routeName}_dept`,
        meta: {
          title: '组织管理',
          icon: renderIcon(PrismSharp),
        },
        component: () => import('@/views/system/dept/index.vue'),
      },
      {
        path: 'role',
        name: `${routeName}_role`,
        meta: {
          title: '角色管理',
          icon: renderIcon(Man),
        },
        component: () => import('@/views/system/role/index.vue'),
      },
      {
        path: 'user',
        name: `${routeName}_user`,
        meta: {
          title: '用户管理',
          icon: renderIcon(UserOutlined),
        },
        component: () => import('@/views/system/user/index.vue'),
      },
      {
        path: 'person-setting',
        name: `${routeName}_person_setting`,
        meta: {
          title: '个人设置',
          hidden:true
        },
        component: () => import('@/views/system/personal/index.vue'),
      },
      {
        path: 'password-change',
        name: `${routeName}_password_change`,
        meta: {
          title: '修改密码',
          hidden:true
        },
        component: () => import('@/views/system/personal/changePassword.vue'),
      },
      {
        path:'demo',
        name: `${routeName}_demo`,
        meta: {
          title: 'demo栏目',
          hidden:false
        },
        component: ParentLayout,
        children:[
          {
            path: 'permission',
            name: `${routeName}_permission`,
            meta: {
              title: '权限管理',
              icon: renderIcon(KeyOutline),
            },
            component: () => import('@/views/demo/permission/permission.vue'),
          },
          {
            path: 'permission_2',
            name: `${routeName}_permission_2`,
            meta: {
              title: '菜单栏子集展示',
            },
            component: () => import('@/views/demo/permission/permission.vue'),
          },
        ]
      }
    ],
  },
];

export default routes;
